<?php

/**
 * AplicacionBeca form base class.
 *
 * @method AplicacionBeca getObject() Returns the current form's model object
 *
 * @package    auip
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseAplicacionBecaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'beca_id'                  => new sfWidgetFormInputHidden(),
      'usuario_id'               => new sfWidgetFormInputHidden(),
      'identificacion_pasaporte' => new sfWidgetFormInputText(),
      'pais_id'                  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Pais'), 'add_empty' => true)),
      'fecha_nacimiento'         => new sfWidgetFormInputText(),
      'lugar_nacimiento'         => new sfWidgetFormInputText(),
      'entidad_origen'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Entidad'), 'add_empty' => true)),
      'entidad_destino'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Entidad'), 'add_empty' => true)),
      'titulo'                   => new sfWidgetFormInputText(),
      'telefono'                 => new sfWidgetFormInputText(),
      'direccion'                => new sfWidgetFormInputText(),
      'actividades'              => new sfWidgetFormTextArea(),      
      'informacion_adicional'    => new sfWidgetFormTextarea(),         
      //'algo'                     => new sfWidgetFormChoice( array('choices'=> '','renderer_class'=> 'sfWidgetFormJQueryAutocompleter',  'renderer_options'=> array('url'=> 'aplicaciones/accion')))
      //'algo' => new sfWidgetFormDoctrineJQueryAutocompleter(array('url'=>'aplicaciones/accion', 'model' => 'Entidad')),      
       //'id_country' => new sfWidgetFormJQueryAutocompleter(array('url' =>'aplicaciones/accion', 'config' => '{extraParams: { second_parametre:function() { return jQuery("#id_html").val();}}, scrollHeight: 250, autoFill: true}')),

    ));

    $this->setValidators(array(
      'beca_id'                  => new sfValidatorChoice(array('choices' => array($this->getObject()->get('beca_id')), 'empty_value' => $this->getObject()->get('beca_id'), 'required' => false)),
      'usuario_id'               => new sfValidatorChoice(array('choices' => array($this->getObject()->get('usuario_id')), 'empty_value' => $this->getObject()->get('usuario_id'), 'required' => false)),
      'identificacion_pasaporte' => new sfValidatorString(),
      'pais_id'                  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Pais'))),
      'fecha_nacimiento'         => new sfValidatorDate(array('required' => false)),
      'lugar_nacimiento'         => new sfValidatorString(array('required' => false)),
      'entidad_origen'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Entidad_5'))),
      'entidad_destino'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Entidad'), 'required' => false)),
      'direccion'                => new sfValidatorString(array('required' => false)),
      'titulo'                   => new sfValidatorString(array('required' => false)),
      'telefono'                 => new sfValidatorString(array('required' => false)),
      'actividades'              => new sfValidatorString(array('required' => false)),
      'informacion_adicional'    => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('aplicacion_beca[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'AplicacionBeca';
  }

}
